<?php
/**
 * Klasse zum Aufbau und Validierung von Formularen
 *
 * @author		Joachim Ruf, Loresoft Software (http://www.loresoft.de)
 * @license		New BSD License
 * @version		Class for Bootstrap v2.3.2
 *
 * */


Class Bootstrap_Formular_Generator
{
	private $arrRow		= array();


	/**
	 *
	 * */
	function __construct () {

	}


	/**
	 * Liefert eine Zeile zurueck.
	 * @param int $i	: Auszugebende Zeile
	 * @return Bootstrap_Formular_Row
	 * */
	public function addRow ($_desc = NULL) {
		$oObject = new Bootstrap_Formular_Row($_desc);
		$this->arrRow[]		= array('desc'		=> $_desc,
									'object'	=> $oObject);
		return $oObject;
	}


	public function display () {
		$content = '';

		if (count($this->arrRow)) {
			foreach ($this->arrRow as $key => $arrVal) {
				/* @var $object Bootstrap_Formular_Row */
				$object		= $arrVal['object'];
				$desc		= $arrVal['desc'];

				$content .= $object->display();
			}
		}

		return '<div class="form-horizontal">
					'.$content.'
				</div>';
	}


}


?>